package E2013;

public class Employee {
    private int id;
    private String name;
    private double basicSalary;
    private double bouns;

    public Employee(int id, String name, double basicSalary, double bouns) {
        this.id = id;
        this.name = name;
        this.basicSalary = basicSalary;
        this.bouns = bouns;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getBasicSalary() {
        return basicSalary;
    }

    public void setBasicSalary(double basicSalary) {
        this.basicSalary = basicSalary;
    }

    public double getBouns() {
        return bouns;
    }

    public void setBouns(double bouns) {
        this.bouns = bouns;
    }
    public double getTax(){
        if ( getBasicSalary()+getBouns()>1600 ){
            return ((getBasicSalary()+getBouns()-1600)*0.15);
        }
       return 0.0;
    }
    public double getRealSalary(){
        double realSalary;
        realSalary = getBasicSalary()+getBouns()-getTax();
        return realSalary;
    }

    public static void main(String[] args) {
        Employee employee = new Employee(1,"jack",1500,200.0);
        double realSalary = employee.getRealSalary();
        double tax = employee.getTax();
        System.out.println(employee.getName()+"\t"+"实际工资:"+realSalary+",所得税："+tax);
    }

}
